package thread;

public class demo16 {
    public static void main(String[] args) {
        Object locker=new Object();//锁对象

        Thread t1=new Thread(()->{
            synchronized (locker){
                //加锁内容
            }
        });

        Thread t2=new Thread(()->{
            synchronized (locker){
                //加锁内容
            }
        });
    }


}
